import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/component_management_ledger_entity.dart';

ComponentManagementLedgerEntity $ComponentManagementLedgerEntityFromJson(Map<String, dynamic> json) {
  final ComponentManagementLedgerEntity componentManagementLedgerEntity = ComponentManagementLedgerEntity();
  final int? auditStatus = jsonConvert.convert<int>(json['auditStatus']);
  if (auditStatus != null) {
    componentManagementLedgerEntity.auditStatus = auditStatus;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    componentManagementLedgerEntity.companyCode = companyCode;
  }
  final String? componentId = jsonConvert.convert<String>(json['componentId']);
  if (componentId != null) {
    componentManagementLedgerEntity.componentId = componentId;
  }
  final String? componentName = jsonConvert.convert<String>(json['componentName']);
  if (componentName != null) {
    componentManagementLedgerEntity.componentName = componentName;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    componentManagementLedgerEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    componentManagementLedgerEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    componentManagementLedgerEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    componentManagementLedgerEntity.deleted = deleted;
  }
  final String? equipmentId = jsonConvert.convert<String>(json['equipmentId']);
  if (equipmentId != null) {
    componentManagementLedgerEntity.equipmentId = equipmentId;
  }
  final String? fileName = jsonConvert.convert<String>(json['fileName']);
  if (fileName != null) {
    componentManagementLedgerEntity.fileName = fileName;
  }
  final String? fileUrl = jsonConvert.convert<String>(json['fileUrl']);
  if (fileUrl != null) {
    componentManagementLedgerEntity.fileUrl = fileUrl;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    componentManagementLedgerEntity.id = id;
  }
  final String? inspectDate = jsonConvert.convert<String>(json['inspectDate']);
  if (inspectDate != null) {
    componentManagementLedgerEntity.inspectDate = inspectDate;
  }
  final String? inspector = jsonConvert.convert<String>(json['inspector']);
  if (inspector != null) {
    componentManagementLedgerEntity.inspector = inspector;
  }
  final String? inspectorId = jsonConvert.convert<String>(json['inspectorId']);
  if (inspectorId != null) {
    componentManagementLedgerEntity.inspectorId = inspectorId;
  }
  final String? nextInspectDate = jsonConvert.convert<String>(json['nextInspectDate']);
  if (nextInspectDate != null) {
    componentManagementLedgerEntity.nextInspectDate = nextInspectDate;
  }
  final String? notes = jsonConvert.convert<String>(json['notes']);
  if (notes != null) {
    componentManagementLedgerEntity.notes = notes;
  }
  final int? type = jsonConvert.convert<int>(json['type']);
  if (type != null) {
    componentManagementLedgerEntity.type = type;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    componentManagementLedgerEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    componentManagementLedgerEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    componentManagementLedgerEntity.updateDate = updateDate;
  }
  return componentManagementLedgerEntity;
}

Map<String, dynamic> $ComponentManagementLedgerEntityToJson(ComponentManagementLedgerEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['auditStatus'] = entity.auditStatus;
  data['companyCode'] = entity.companyCode;
  data['componentId'] = entity.componentId;
  data['componentName'] = entity.componentName;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['equipmentId'] = entity.equipmentId;
  data['fileName'] = entity.fileName;
  data['fileUrl'] = entity.fileUrl;
  data['id'] = entity.id;
  data['inspectDate'] = entity.inspectDate;
  data['inspector'] = entity.inspector;
  data['inspectorId'] = entity.inspectorId;
  data['nextInspectDate'] = entity.nextInspectDate;
  data['notes'] = entity.notes;
  data['type'] = entity.type;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension ComponentManagementLedgerEntityExtension on ComponentManagementLedgerEntity {
  ComponentManagementLedgerEntity copyWith({
    int? auditStatus,
    String? companyCode,
    String? componentId,
    String? componentName,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? equipmentId,
    String? fileName,
    String? fileUrl,
    String? id,
    String? inspectDate,
    String? inspector,
    String? inspectorId,
    String? nextInspectDate,
    String? notes,
    int? type,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return ComponentManagementLedgerEntity()
      ..auditStatus = auditStatus ?? this.auditStatus
      ..companyCode = companyCode ?? this.companyCode
      ..componentId = componentId ?? this.componentId
      ..componentName = componentName ?? this.componentName
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..equipmentId = equipmentId ?? this.equipmentId
      ..fileName = fileName ?? this.fileName
      ..fileUrl = fileUrl ?? this.fileUrl
      ..id = id ?? this.id
      ..inspectDate = inspectDate ?? this.inspectDate
      ..inspector = inspector ?? this.inspector
      ..inspectorId = inspectorId ?? this.inspectorId
      ..nextInspectDate = nextInspectDate ?? this.nextInspectDate
      ..notes = notes ?? this.notes
      ..type = type ?? this.type
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
